<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>酒店管理系统</title>
    <meta name="description" content="现代化酒店管理系统，提供前台接待、客房管理、财务账务、会员营销等功能" />
    <meta name="keywords" content="酒店管理,前台接待,客房管理,财务管理,会员系统" />
    <meta name="author" content="Hotel Management Team" />
    
    <!-- Favicon -->
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
    
    <!-- 预加载关键资源 -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    
    <!-- 样式重置 -->
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      
      html, body {
        height: 100%;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        background-color: #f5f7fa;
      }
      
      #app {
        height: 100%;
      }
      
      /* 加载动画 */
      .loading-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
      }
      
      .loading-spinner {
        width: 50px;
        height: 50px;
        border: 4px solid rgba(255, 255, 255, 0.3);
        border-top: 4px solid #fff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
      }
      
      .loading-text {
        color: #fff;
        font-size: 16px;
        margin-top: 20px;
        text-align: center;
      }
      
      @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
      }
      
      /* 隐藏加载动画 */
      .loading-container.hidden {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <!-- 初始加载动画 -->
      <div id="loading" class="loading-container">
        <div>
          <div class="loading-spinner"></div>
          <div class="loading-text">
            <div>酒店管理系统</div>
            <div style="font-size: 14px; margin-top: 10px; opacity: 0.8;">正在加载中...</div>
          </div>
        </div>
      </div>
    </div>
    
    <script type="module" src="/src/main.js"></script>
    
    <script>
      // 页面加载完成后隐藏加载动画
      window.addEventListener('load', function() {
        setTimeout(function() {
          const loading = document.getElementById('loading');
          if (loading) {
            loading.classList.add('hidden');
            setTimeout(function() {
              loading.remove();
            }, 300);
          }
        }, 500);
      });
      
      // 错误处理
      window.addEventListener('error', function(e) {
        console.error('页面加载错误:', e.error);
      });
      
      // 未处理的Promise错误
      window.addEventListener('unhandledrejection', function(e) {
        console.error('未处理的Promise错误:', e.reason);
      });
    </script>
  </body>
</html>